PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

PtInIconRef

Tests whether a specified point falls within an icon's mask.

pascal Boolean PtInIconRef(
                     Point*testPt,
                     Rect*iconRect,
                     IconAlignmentType align,
                     IconServicesUsageFlagsiconServicesUsageFlags,
                     IconRef iconRef);

testPt
A pointer to a value of type Point , specified in local coordinates of the current graphics port. This value specifies the location that Icon Services tests to see whether it falls within the mask of the indicated icon.

iconRect
A pointer to a value of type Rect . This value defines the area that Icon Services uses to determine which icon is hit-tested. Use the same Rect value as when the icon was last drawn.

align
A value of type IconAlignmentType that specifies how the indicated icon is aligned within the rectangle specified in the iconRect parameter. Use the same IconAlignmentType value as when the icon was last drawn. for a description of possible return values, see Icon Alignment Constants .

iconServicesUsageFlags
Reserved for future use. Pass the kIconServicesDefaultUsageFlags constant in this parameter.

iconRef
A pointer to a value of type IconRef specifying the icon to test.

function result
true if the point specified in the testPt parameter falls within the appropriate icon mask, false otherwise.
DISCUSSION
This function is similar to the Icon Utilities function PtInIconSuite . The function is useful when you want to determine whether a user has clicked on a particular icon, for example. For a description of Icon Utilities functions and data structures, see Inside Macintosh: More Macintosh Toolbox.

Note

Icon Services uses the icon's black-and-white mask for hit-testing, even if you provide a deep mask.


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)